//
//  UIButton+Extension.swift
//  01-weiboSwift
//
//  Created by TwistFate on 16/3/3.
//  Copyright © 2016年 TwistFate. All rights reserved.
//

import UIKit

extension UIButton {

    convenience init(imageName : String ,bkgImageName :String ,title : String) {
        self.init()
        
        setImage(UIImage(named:imageName), forState: UIControlState.Normal)
        
        setBackgroundImage(UIImage(named:bkgImageName), forState: UIControlState.Normal)
        setBackgroundImage(UIImage(named:bkgImageName+"_highlighted"), forState: UIControlState.Highlighted)
        
        setTitle(title, forState: UIControlState.Normal)
        
        setTitleColor(UIColor.darkGrayColor(), forState: UIControlState.Normal)
        
        titleLabel?.font = UIFont.systemFontOfSize(11)

    }
}